<!--{template /module/admin/view/head}-->
<link href="static/css/black-b-micon.css" rel="stylesheet" />
<style type="text/css">
.row-fluid .span3 {width:300px;}
.row-fluid .span4 {width:400px;}
.row-fluid .span4 {width:400px;}
</style>

<div id="_div_stat_ajax" style="display:none;"></div>

<div id="left_layout">
	<div id="main_content" class="container-fluid">		
		<div class="row-fluid">
			<div class="span3">
				<div class="well widget">
					<div class="widget-header">
						<h3 class="title"><i class="micon micon-144"></i> {lang admin.frame_desktop.system}</h3>
					</div>
					<div class="widget-content">
						<ol class="system">
							<li>{lang admin.frame_desktop.system.sys}：{echo PHP_OS.' / PHP'.PHP_VERSION;}</li>
							<li>{lang admin.frame_desktop.system.apache}：{$servers[0]}</li>
							<li>{lang admin.frame_desktop.system.mysql}：{$mysqls[0]}</li>
							<li>{lang admin.frame_desktop.system.version}：{$setting[Application]}{$setting[Business]} {$setting[Version]} <span class="state">{$setting[VersionState]}</span></li>
							<li>{lang admin.frame_desktop.system.sn}：{$config[crypt]}</li>
							<li class="run">{lang admin.frame_desktop.system.run} <span>{echo timespan(time(), strtotime($setting['CreateTime']));}</span> {lang admin.frame_desktop.system.day}</li>
							
							<li class="check-updating">
								<button class="btn btn-mini">{lang admin.frame_desktop.system.version.button}</button>
							</li>
						</ol>
					</div>
				</div>
				
				<!--{if count($modules) > 0}-->
				<div class="well widget">
					<div class="widget-header">
						<h3 class="title"><i class="micon micon-140"></i> {lang admin.frame_desktop.module}</h3>
					</div>
					<div class="widget-content">
						<ul class="module">
							<!--{code $loop_count = 0;}-->
							<!--{loop $modules $loop $module}-->
							<li class="{echo $loop_count == 0 ? 'first' : '';}">
								<a href="{$module[URL]}" target="frm_content_top">
									<p class="icon">
										 <span class="black-b-micon black-b-{$module[ICON]}"></span>
									</p>
									<p class="name">{$module[CNAME]}</p>
								</a>
							</li>
							<!--{code $loop_count = $loop_count + 1;}-->
							<!--{/loop}-->
							<br class="clear"/>
						</ul>
					</div>
				</div>
				<!--{/if}-->
				
				<div class="well widget">
					<div class="widget-header">
						<h3 class="title"><i class="micon micon-180"></i> {lang admin.frame_desktop.task}</h3>
					</div>
					<div class="widget-content">
						<ol>
							<!--{if $menus['order_audit']}-->
							<li>
								{lang admin.frame_desktop.task.order.audit} <a href="{$ADMIN_SCRIPT}/order/audit">{$task[ORDER_DEAL]}</a> {lang admin.frame_desktop.task.num}
							</li>
							<!--{/if}-->
							
							<!--{if $menus['cms_comment']}-->
							<li>
								{lang admin.frame_desktop.task.cms.comment.audit} <a href="{$ADMIN_SCRIPT}/cms/comment">{$task[COMMENT_ARTICLE]}</a> {lang admin.frame_desktop.task.num}
							</li>
							<!--{/if}-->
							
							<!--{if $menus['product_comment']}-->
							<li>
								{lang admin.frame_desktop.task.product.comment.audit} <a href="{$ADMIN_SCRIPT}/product/comment">{$task[COMMENT_PRODUCT]}</a> {lang admin.frame_desktop.task.num}
							</li>
							<!--{/if}-->
							
							<!--{if $menus['note_record']}-->
							<li>
								{lang admin.frame_desktop.task.record.reply} <a href="{$ADMIN_SCRIPT}/note/record">{$task[NOTE_RECORD]}</a> {lang admin.frame_desktop.task.num}
							</li>
							<!--{/if}-->
							
							<!--{if $menus['order_complaint']}-->
							<li>
								{lang admin.frame_desktop.task.complaint.deal} <a href="{$ADMIN_SCRIPT}/order/complaint">{$task[COMPLAINT_RECORD]}</a> 个
							</li>
							<!--{/if}-->
						</ol>
					</div>
				</div>
			</div>
			
			<div class="span4">
				<div class="well widget">
					<div class="widget-header">
						<h3 class="title"><i class="micon micon-152"></i> {lang admin.frame_desktop.stat.title.all}</h3>
					</div>
					<div class="widget-content">
						<table class="table">
							<thead>
								<tr>
									<th width="80">#</th>
									<th>{lang admin.frame_desktop.stat.cms}</th>
									<!--{if $menus['cms_comment']}-->
									<th>{lang admin.frame_desktop.stat.cms.comment}</th>
									<!--{/if}-->
									<!--{if $menus['product_main']}-->
									<th>{lang admin.frame_desktop.stat.product}</th>
									<!--{/if}-->
									<!--{if $menus['order_main']}-->
									<th>{lang admin.frame_desktop.stat.order}</th>
									<!--{/if}-->
								</tr>
							</thead>
							<tbody id="tbody_stat_all">
								<tr>
									<td colspan="5">
										<p class="muted">{lang admin.frame_desktop.stat.loading}</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				
				<div class="well widget">
					<div class="widget-header">
						<h3 class="title"><i class="micon micon-152"></i> {lang admin.frame_desktop.stat.title.sale}</h3>
					</div>
					<div class="widget-content">
						<table class="table">
							<thead>
								<tr>
									<th width="80">#</th>
									<th>{lang admin.frame_desktop.stat.viewlog}</th>
									<!--{if $menus['user_main']}-->
									<th>{lang admin.frame_desktop.stat.user}</th>
									<!--{/if}-->
									<!--{if $menus['order_main']}-->
									<th>{lang admin.frame_desktop.stat.buy}</th>
									<!--{/if}-->
								</tr>
							</thead>
							<tbody id="tbody_stat_sale">
								<tr>
									<td colspan="5">
										<p class="muted">{lang admin.frame_desktop.stat.loading}</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</div>
			
			<div class="span4">
				<div class="well widget">
					<div class="widget-header">
						<h3 class="title"><i class="micon micon-126"></i> {lang admin.frame_desktop.data.title}</h3>
						<div class="widget-nav">
							<button type="button" class="btn btn-small btn-data">{lang admin.frame_desktop.data.flash}</button>&nbsp;
						</div>
					</div>
					
					<div class="widget-content" id="widget_data">
						<!--{template /module/admin/view/desktop_data}-->
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<script>
$(function(){
	$('.check-updating .btn').click(function(){
		var self = this;
		$(self).text('{lang admin.frame_desktop.system.version.buttong.checking}');
		
		$.getJSON('{$ADMIN_SCRIPT}/admin/desktop/updating&rnd=' + Math.random(), {}, function(data){
			setTimeout(function(){
				if(data.button) $(self).text(data.button);
				if(data.message) $.dialog({message:data.message});
				else if(!data.version) $('.system .state').hide();
			}, 500);
		});
	});
	
	$('.module li').hover(function(){
		$(this).addClass('hover');
	}, function(){
		$(this).removeClass('hover');
	});
	
	$('.btn-data').click(function(){
		$('#widget_data').html('{lang admin.frame_desktop.data.loading}');
		
		$.get('{$ADMIN_SCRIPT}/admin/desktop/data&rnd=' + Math.random(), {}, function(data){
			setTimeout(function(){
				$('#widget_data').html(data);
			}, 500);
		});
	});
	
	setTimeout(function(){
		$.get('{$ADMIN_SCRIPT}/admin/desktop/stat&rnd=' + Math.random(), {}, function(data){
			$('#_div_stat_ajax').html(data);
			$('#tbody_stat_all').html($('#_txt_stat_ajax_all').val());
			$('#tbody_stat_sale').html($('#_txt_stat_ajax_sale').val());
		});
	}, 500);
	
	{if $setting['CheckUpdating']}
	$('.check-updating .btn').click();
	{/if}
});
</script>

<!--{template /module/admin/view/foot}-->